home *** CD-ROM | disk | FTP | other *** search
Gui4CLI script | 1999-11-24 | 3.6 KB | 171 lines |
- G4C
-
- WINBIG 208 36 241 179 "FastRead.gc"
- wintype 11010001
- resinfo 8 640 256
- varpath "viewtext.g"
-
- xonreload
- guiopen fastread.gc
-
- xonload
- extract fastread.gc guipath fre_path
- assign GCHELP: $fre_path
- delvar fre_path
- ttget gchelp:fastread.gc
- guiload gchelp:viewtext.g
- ifexists port AREXX
- ;Nop
- elseifexists file sys:system/rexxmast
- run 'sys:system/rexxmast >nil:'
- else
- ezreq "Can't start ARexx" Okay ""
- assign gchelp: remove
- guiquit viewtext.g
- guiquit fastread.gc
- endif
-
- guide = $*FRGUIDE ; change this
-
- if $guide = ''
- reqfile -1 -1 200 -60 'Select A Document' load guide GUIS:Docs
- if $guide = ''
- assign GCHELP: remove
- guiquit viewtext.g
- guiquit fastread.gc
- stop
- endif
- endif
-
- extract guide file list
- appvar list .idx
- joinfile gchelp:idx $list list
- ifexists file c:getnodes
- andifexists file c:writenode
- run 'resident c:getnodes pure add'
- run 'resident c:writenode pure add'
- elseifexists file guis:c/getnodes
- andifexists file guis:c/writenode
- run 'resident guis:c/getnodes pure add'
- run 'resident guis:c/writenode pure add'
- else
- ezreq "Cannot Find Binaries." Okay ""
- gosub fastread.gc exit
- endif
- ifexists file $list
- ;nop
- else
- cli 'getnodes $guide $list'
- endif
- lvuse fastread.gc 1
- lvchange $list
- guiopen fastread.gc
- extract guide file wtitle
- extract wtitle unquote wtitle
- setwintitle fastread.gc '$wtitle'
-
-
- xonkey #v
- xonkey #r
- if $$rawkey.code = 95
- cli 'writenode guis:docs/helpsystem.txt 8655 1826'
- guiopen viewtext.g
- set translation off
- lvuse viewtext.g 1
- lvchange ram:guide.txt
- elseif $$rawkey.code = 78
- lvuse fastread.gc 1
- lvmove 1
- elseif $$rawkey.code = 79
- lvuse fastread.gc 1
- lvmove -1
- endif
-
- xonclose
- gosub fastread.gc exit
-
- XTEXTIN 0 0 163 13 "" txt "" 80
- attr resize 0020
- gadhelp 'Enter text to search for'
- if $txt > ''
- lvuse fastread.gc 1
- lvsearch $txt ci first
- endif
- gosub fastread.gc search_update
-
- XBUTTON 164 0 19 13 ยป
- attr resize 2000
- gadhelp 'Find next..'
- if $txt > ''
- lvuse fastread.gc 1
- lvsearch $txt ci next
- endif
- gosub fastread.gc search_update
-
- XBUTTON 183 0 17 13 "R" ; re-index the guide
- attr resize 2000
- gadhelp 'Re-Index guide (in case it has been edited)'
- guiwindow fastread.gc wait
- cli 'getnodes $guide $list'
- lvuse fastread.gc 1
- lvchange $list
- guiwindow fastread.gc resume
-
-
- XBUTTON 200 0 40 13 Open
- attr resize 2000
- gadhelp 'Load an other guide'
- reqfile -1 -1 200 -60 'Select A Guide:' load doc GUIS:Docs
- ifexists file $doc
- guide = $doc
- extract guide file list
- appvar list .idx
- joinfile gchelp:idx $list list
- ifexists file $list
- ;nop
- else
- cli 'getnodes $guide $list'
- endif
- lvuse fastread.gc 1
- lvchange $list
- extract guide file wtitle
- extract wtitle unquote wtitle
- setwintitle fastread.gc '$wtitle'
- endif
-
- XLISTVIEW 0 13 240 166 '' topic '' 0 txt
- attr resize 0022
- gadid 1
- gosub fastread.gc fetchtext
- gadfont #mono 8 000
-
- xroutine fetchtext
- cutvar topic cut word -2 offset
- extract topic upper topic
- extract topic unquote topic
- cli 'writenode $guide $offset'
- guiopen viewtext.g
- update viewtext.g 2 "Subject: $topic"
- set translation off
- lvuse viewtext.g 1
- lvchange ram:guide.txt
-
- xroutine search_update
- if $$lv.line > ''
- update fastread.gc 1 $$lv.line
- else
- lvgo #0
- update fastread.gc 1 0
- endif
-
- xroutine exit
- assign GCHELP: remove
- run 'resident getnodes remove'
- run 'resident writenode remove'
- ifexists file ram:guide.txt
- delete ram:guide.txt
- endif
- guiquit viewtext.g
- guiquit fastread.gc
-
-